{template 'admin','header'}
<script type="text/javascript">
    $(document).ready(function(){
        $("option[value=<?=$res['parentcode']?>]").attr("selected","true");
    });
</script>
<form action="admin/type.php?action=edit&tid={$res['tid']}" method="post" onsubmit="return r_submit(this);">
<table cellspacing="1" cellpadding="0" class="table_form">
    <caption>分类添加</caption>
<tbody>
    <tr>
        <td class="align_r" width="30%"><strong>分类code</strong></td><td><input type="text" id="code" name="type[code]" value="{$res['tcode']}" maxlength="20" /><font color="red">*</font></td>
    </tr>
    <tr>
        <td class="align_r" width="30%"><strong>分类名称</strong></td><td><input type="text" id="name" name="type[name]" value="{$res['tname']}" maxlength="190" size="60"/><font color="red">*</font></td>
    </tr>
    <tr>
        <td class="align_r" width="30%"><strong>父分类</strong></td>
        <td>
        <?=type::select_options($options, '', 'type[pcode]', '无', 'pcode');?>
        </td>
    </tr>
    <tr>
        <td></td><td><input type="submit" value="修改"/>&nbsp;&nbsp;&nbsp;<input type="button" value="返回" onclick="self.location='{urldecode($forward)}'" /></td>
    </tr>
<input type="hidden" value="{$res['tcode']}" name="type[firstcode]" />
</tbody>
</table>
</form>
{template 'admin','footer'}
